<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<c:forEach var="count" begin="0" end="${gerisayimListesi.size()}" step="2">

	<div class="row Countdowns">
		<c:if test="${count < gerisayimListesi.size()}">
			<c:set var="gerisayim1" value="${gerisayimListesi.get(count)}"></c:set>
			<c:set var="tarih">${gerisayim1.gerisayimTarihi}</c:set>
			<c:set var="saat">${gerisayim1.gerisayimSaati}</c:set>
			<c:set var="tarihDizi" value="${fn:split(tarih, '-')}" />
			<c:set var="saatDizi" value="${fn:split(saat, ':')}" />

			<div class="col-md-6">
				<div class="panel panel-success">
					<div class="panel-heading">
						<div class="panel-title ">
							<i class="glyphicon glyphicon-time"></i> ${gerisayim1.gerisayimAdi}
						</div>
					</div>
					<div class="panel-body">
						<div class="countdown simple" data-date="${tarihDizi[1]} ${tarihDizi[2]}, ${tarihDizi[0]} ${saatDizi[0]}:${saatDizi[1]}:00"></div>
					</div>
				</div>
			</div>
		</c:if>
		
		<c:if test="${count+1 <  gerisayimListesi.size()}">

			<c:set var="gerisayim2" value="${gerisayimListesi.get(count+1)}"></c:set>
			<c:set var="tarih">${gerisayim2.gerisayimTarihi}</c:set>
			<c:set var="saat">${gerisayim2.gerisayimSaati}</c:set>
			<c:set var="tarihDizi" value="${fn:split(tarih, '-')}" />
			<c:set var="saatDizi" value="${fn:split(saat, ':')}" />

			<div class="col-md-6">
				<div class="panel panel-success">
					<div class="panel-heading">
						<div class="panel-title ">
							<i class="glyphicon glyphicon-time"></i> ${gerisayim2.gerisayimAdi}
						</div>
					</div>
					<div class="panel-body">
						<div class="countdown simple" data-date="${tarihDizi[1]} ${tarihDizi[2]}, ${tarihDizi[0]} ${saatDizi[0]}:${saatDizi[1]}:00"></div>
					</div>
				</div>
			</div>

		</c:if>
	</div>
</c:forEach>   